import request from '@/utils/request'

export function getBlogList() {
  return request({
    url: '/getBlogList',
    method: 'get'
  })
}

export function changStatus(id,status) {
  return request({
    url: '/changStatus',
    method: 'post',
    params:{
      id,
      status
    }
  })
}

export function getLabel() {
  return request({
    url: '/getLabel',
    method: 'get'
  })
}

export function submitBlog(data) {
  return request({
    url: '/saveBlog',
    method: 'post',
    data
  })
}

export function saveDraft(data) {
  return request({
    url: '/saveDraft',
    method: 'post',
    data
  })
}

export function updateBlog(data) {
  return request({
    url: '/updateBlog',
    method: 'post',
    data
  })
}

export function deleteBlog(id,MIMA) {
  return request({
    url: '/deleteBlog',
    method: 'get',
    params:{
      id:id,
      assert:MIMA
    }
  })
}

export function getBlogById(id) {
  return request({
    url: '/getBlogById',
    method: 'get',
    params:{
      blogId:id
    }
  })
}
